package cn.iocoder.yudao.module.wine.dal.mysql.leaveinfo;

import java.util.*;
import java.util.stream.Collectors;

import cn.hutool.core.collection.CollectionUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.ip.core.Area;
import cn.iocoder.yudao.framework.ip.core.enums.AreaTypeEnum;
import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
import cn.iocoder.yudao.module.wine.controller.admin.supplyinfo.vo.SupplyInfoRespVO;
import cn.iocoder.yudao.module.wine.controller.app.leaveinfo.vo.AppLeaveInfoPageReqVO;
import cn.iocoder.yudao.module.wine.controller.app.leaveinfo.vo.AppLeaveInfoRespVO;
import cn.iocoder.yudao.module.wine.dal.dataobject.businesscredit.BusinessCreditDO;
import cn.iocoder.yudao.module.wine.dal.dataobject.businessuser.BusinessUserDO;
import cn.iocoder.yudao.module.wine.dal.dataobject.leaveinfo.LeaveInfoDO;
import cn.iocoder.yudao.module.wine.dal.dataobject.membertype.MemberTypeDO;
import cn.iocoder.yudao.module.wine.dal.dataobject.userfans.UserFansDO;
import cn.iocoder.yudao.module.wine.enums.LeaveInfoAuditEnum;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.wine.controller.admin.leaveinfo.vo.*;

/**
 * 发布离职通告 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface LeaveInfoMapper extends BaseMapperX<LeaveInfoDO> {

    default PageResult<LeaveInfoRespVO> selectPage(LeaveInfoPageReqVO reqVO) {
        return selectJoinPage(reqVO, LeaveInfoRespVO.class, new MPJLambdaWrapperX<LeaveInfoDO>()
                .eqIfPresent(LeaveInfoDO::getUserId, reqVO.getUserId())
                .likeIfPresent(LeaveInfoDO::getInfoName, reqVO.getInfoName())
                .likeIfPresent(LeaveInfoDO::getRealName, reqVO.getRealName())
                .likeIfPresent(LeaveInfoDO::getIdCard, reqVO.getIdCard())
                .eqIfPresent(LeaveInfoDO::getSex, reqVO.getSex())
                .eqIfPresent(LeaveInfoDO::getBirthday, reqVO.getBirthday())
                .eqIfPresent(LeaveInfoDO::getAge, reqVO.getAge())
                .eqIfPresent(LeaveInfoDO::getImage, reqVO.getImage())
                .eqIfPresent(LeaveInfoDO::getImages, reqVO.getImages())
                .eqIfPresent(LeaveInfoDO::getDescription, reqVO.getDescription())
                .eqIfPresent(LeaveInfoDO::getIsTop, reqVO.getIsTop())
                .eqIfPresent(LeaveInfoDO::getSort, reqVO.getSort())
                .betweenIfPresent(LeaveInfoDO::getCreateTime, reqVO.getCreateTime())
                .selectAll(LeaveInfoDO.class).select(MemberUserDO::getNickname)
                .selectAs(MemberUserDO::getName,LeaveInfoRespVO::getName)
                .leftJoin(MemberUserDO.class, MemberUserDO::getId, LeaveInfoDO::getUserId)
                .orderByDesc(LeaveInfoDO::getCreateTime));
    }

    default PageResult<AppLeaveInfoRespVO> selectLeaveInfoList(AppLeaveInfoPageReqVO reqVO) {
        List<Integer> areaList = new ArrayList<>();
        if (reqVO.getAreaId() != null) {
            Integer areaId = reqVO.getAreaId();
            Area area = AreaUtils.getArea(areaId);
            if (area.getType().equals(AreaTypeEnum.PROVINCE.getType())) {
                List<Area> children = area.getChildren();
                List<Integer> collect = children.stream().map(item -> item.getId()).collect(Collectors.toList());
                collect.forEach(item -> {
                    Area area1 = AreaUtils.getArea(item);
                    List<Integer> collect1 = area1.getChildren().stream().map(data -> data.getId()).collect(Collectors.toList());
                    areaList.addAll(collect1);
                });
                areaList.addAll(collect);
            }
            if (area.getType().equals(AreaTypeEnum.CITY.getType())) {
                List<Area> children = area.getChildren();
                List<Integer> collect = children.stream().map(item -> item.getId()).collect(Collectors.toList());
                areaList.addAll(collect);
            }
        }

        return selectJoinPage(reqVO, AppLeaveInfoRespVO.class, new MPJLambdaWrapperX<LeaveInfoDO>()
                .likeIfPresent(LeaveInfoDO::getInfoName, reqVO.getInfoName())
                .eqIfPresent(LeaveInfoDO::getUserId, reqVO.getUserId())
                .eqIfPresent(LeaveInfoDO::getSex, reqVO.getSex())
                .eqIfPresent(LeaveInfoDO::getBirthday, reqVO.getBirthday())
                .eqIfPresent(LeaveInfoDO::getAge, reqVO.getAge())
                .eqIfPresent(LeaveInfoDO::getDescription, reqVO.getDescription())
                .eqIfPresent(LeaveInfoDO::getIsTop, reqVO.getIsTop())
                .eqIfPresent(LeaveInfoDO::getSort, reqVO.getSort())
                .eqIfPresent(LeaveInfoDO::getAudit, LeaveInfoAuditEnum.PASS_THE_AUDIT.getCode())
                .in(!CollectionUtil.isEmpty(areaList), BusinessUserDO::getAreaId, areaList)
                .leftJoin(MemberUserDO.class, MemberUserDO::getId, LeaveInfoDO::getUserId)
                .leftJoin(BusinessUserDO.class, BusinessUserDO::getUserId, LeaveInfoDO::getUserId)
                .leftJoin(BusinessCreditDO.class, BusinessCreditDO::getId, BusinessUserDO::getCreditId)
                .leftJoin(MemberTypeDO.class, MemberTypeDO::getId, BusinessUserDO::getMemberTypeId)

                .selectAs(BusinessCreditDO::getLevel, AppLeaveInfoRespVO::getLevel)
                .selectAs(BusinessCreditDO::getIcon, AppLeaveInfoRespVO::getIcon)
                .selectAs(BusinessCreditDO::getId, AppLeaveInfoRespVO::getCreditId)
                .selectAs(BusinessCreditDO::getName, AppLeaveInfoRespVO::getCreditName)

                .selectAs(BusinessUserDO::getIsAuth, AppLeaveInfoRespVO::getIsAuth)
                .selectAs(BusinessUserDO::getAreaId, AppLeaveInfoRespVO::getUserAreaId)
                .selectAs(BusinessUserDO::getBondName, AppLeaveInfoRespVO::getBondName)

                .selectAs(MemberTypeDO::getName, AppLeaveInfoRespVO::getMemberTypeName)
                .selectAs(MemberTypeDO::getIcon, AppLeaveInfoRespVO::getMemberTypeIcon)

                .selectAs(MemberUserDO::getNickname, AppLeaveInfoRespVO::getNickname)
                .selectAs(MemberUserDO::getAvatar, AppLeaveInfoRespVO::getAvatar)
                .selectAs(MemberUserDO::getMark, AppLeaveInfoRespVO::getMark)

                .selectAll(LeaveInfoDO.class)
                .orderByDesc(LeaveInfoDO::getCreateTime)
        );
    }

    default List<AppLeaveInfoRespVO> getMyPublishLeaveInfoList(AppLeaveInfoPageReqVO reqVO) {

        return selectJoinList(AppLeaveInfoRespVO.class, new MPJLambdaWrapperX<LeaveInfoDO>()
                .eqIfPresent(LeaveInfoDO::getUserId, reqVO.getUserId())
                .likeIfPresent(LeaveInfoDO::getInfoName, reqVO.getInfoName())
                .eqIfPresent(LeaveInfoDO::getSex, reqVO.getSex())
                .eqIfPresent(LeaveInfoDO::getBirthday, reqVO.getBirthday())
                .eqIfPresent(LeaveInfoDO::getAge, reqVO.getAge())
                .or(wrapper -> {
                    wrapper.likeIfExists(LeaveInfoDO::getDescription, reqVO.getInfoName())
                            .eqIfExists(LeaveInfoDO::getUserId, reqVO.getUserId())
                            .eqIfExists(LeaveInfoDO::getSex, reqVO.getSex())
                            .eqIfExists(LeaveInfoDO::getBirthday, reqVO.getBirthday())
                            .eqIfExists(LeaveInfoDO::getAge, reqVO.getAge());
                })
                .or(wrapper -> {
                    wrapper.likeIfExists(LeaveInfoDO::getCompany, reqVO.getInfoName())
                            .eqIfExists(LeaveInfoDO::getUserId, reqVO.getUserId())
                            .eqIfExists(LeaveInfoDO::getSex, reqVO.getSex())
                            .eqIfExists(LeaveInfoDO::getBirthday, reqVO.getBirthday())
                            .eqIfExists(LeaveInfoDO::getAge, reqVO.getAge());
                })
                .or(wrapper -> {
                    wrapper.likeIfExists(LeaveInfoDO::getRealName, reqVO.getInfoName())
                            .eqIfExists(LeaveInfoDO::getUserId, reqVO.getUserId())
                            .eqIfExists(LeaveInfoDO::getSex, reqVO.getSex())
                            .eqIfExists(LeaveInfoDO::getBirthday, reqVO.getBirthday())
                            .eqIfExists(LeaveInfoDO::getAge, reqVO.getAge());
                })
                .leftJoin(MemberUserDO.class, MemberUserDO::getId, LeaveInfoDO::getUserId)
                .leftJoin(BusinessUserDO.class, BusinessUserDO::getUserId, LeaveInfoDO::getUserId)
                .leftJoin(BusinessCreditDO.class, BusinessCreditDO::getId, BusinessUserDO::getCreditId)
                .leftJoin(MemberTypeDO.class, MemberTypeDO::getId, BusinessUserDO::getMemberTypeId)

                .selectAs(BusinessCreditDO::getLevel, AppLeaveInfoRespVO::getLevel)
                .selectAs(BusinessCreditDO::getIcon, AppLeaveInfoRespVO::getIcon)
                .selectAs(BusinessCreditDO::getId, AppLeaveInfoRespVO::getCreditId)
                .selectAs(BusinessCreditDO::getName, AppLeaveInfoRespVO::getCreditName)

                .selectAs(BusinessUserDO::getIsAuth, AppLeaveInfoRespVO::getIsAuth)
                .selectAs(BusinessUserDO::getAreaId, AppLeaveInfoRespVO::getUserAreaId)
                .selectAs(BusinessUserDO::getBondName, AppLeaveInfoRespVO::getBondName)

                .selectAs(MemberTypeDO::getName, AppLeaveInfoRespVO::getMemberTypeName)
                .selectAs(MemberTypeDO::getIcon, AppLeaveInfoRespVO::getMemberTypeIcon)
                .selectAs(MemberUserDO::getNickname, AppLeaveInfoRespVO::getNickname)
                .selectAs(MemberUserDO::getAvatar, AppLeaveInfoRespVO::getAvatar)

                .selectAll(LeaveInfoDO.class)
                .orderByDesc(LeaveInfoDO::getCreateTime)
        );
    }

    default AppLeaveInfoRespVO getJoinById(Integer id) {
        return selectJoinOne(AppLeaveInfoRespVO.class, new MPJLambdaWrapperX<LeaveInfoDO>()
                .eq(LeaveInfoDO::getId, id)
                .leftJoin(UserFansDO.class,
                        on -> on.eq(UserFansDO::getUserId, LeaveInfoDO::getUserId)
                                .eq(UserFansDO::getFansId, SecurityFrameworkUtils.getLoginUserId())
                )
                .leftJoin(BusinessUserDO.class, BusinessUserDO::getUserId, LeaveInfoDO::getUserId)
                .leftJoin(BusinessCreditDO.class, BusinessCreditDO::getId, BusinessUserDO::getCreditId)
                .leftJoin(MemberUserDO.class, MemberUserDO::getId, BusinessUserDO::getUserId)
                .selectAll(LeaveInfoDO.class)

                .selectAs(MemberUserDO::getNickname, AppLeaveInfoRespVO::getNickname)
                .selectAs(MemberUserDO::getAvatar, AppLeaveInfoRespVO::getAvatar)
                .selectAs(MemberUserDO::getMark, AppLeaveInfoRespVO::getMark)

                .selectAs(BusinessCreditDO::getLevel, AppLeaveInfoRespVO::getLevel)
                .selectAs(BusinessCreditDO::getIcon, AppLeaveInfoRespVO::getIcon)
                .selectAs(BusinessCreditDO::getId, AppLeaveInfoRespVO::getCreditId)
                .selectAs(BusinessCreditDO::getName, AppLeaveInfoRespVO::getCreditName)

                .selectAs(UserFansDO::getSubscribeStatus, AppLeaveInfoRespVO::getSubscribeStatus)

                .selectAs(BusinessUserDO::getAreaId, AppLeaveInfoRespVO::getUserAreaId)
                .selectAs(BusinessUserDO::getBondName, AppLeaveInfoRespVO::getBondName)
        );
    }

    default PageResult<AppLeaveInfoRespVO> selectLeaveInfoListBack(AppLeaveInfoPageReqVO reqVO) {
        List<Integer> areaList = new ArrayList<>();
        if (reqVO.getAreaId() != null) {
            Integer areaId = reqVO.getAreaId();
            Area area = AreaUtils.getArea(areaId);
            if (area.getType().equals(AreaTypeEnum.PROVINCE.getType())) {
                List<Area> children = area.getChildren();
                List<Integer> collect = children.stream().map(item -> item.getId()).collect(Collectors.toList());
                collect.forEach(item -> {
                    Area area1 = AreaUtils.getArea(item);
                    List<Integer> collect1 = area1.getChildren().stream().map(data -> data.getId()).collect(Collectors.toList());
                    areaList.addAll(collect1);
                });
                areaList.addAll(collect);
            }
            if (area.getType().equals(AreaTypeEnum.CITY.getType())) {
                List<Area> children = area.getChildren();
                List<Integer> collect = children.stream().map(item -> item.getId()).collect(Collectors.toList());
                areaList.addAll(collect);
            }
        }
//        String keywords = reqVO.getKeywords();
//        if (!StringUtils.isEmpty(keywords)) {
//            String[] split = keywords.split(" ");
//            List<AppLeaveInfoRespVO> list = new ArrayList<>();
//            for (String s : split) {
//                List<AppLeaveInfoRespVO> data = selectJoinList(AppLeaveInfoRespVO.class, new MPJLambdaWrapperX<LeaveInfoDO>()
//                        .likeIfPresent(LeaveInfoDO::getInfoName, s)
//                        .eqIfPresent(LeaveInfoDO::getUserId, reqVO.getUserId())
//                        .eqIfPresent(LeaveInfoDO::getBirthday, reqVO.getBirthday())
//                        .eqIfPresent(LeaveInfoDO::getIsTop, reqVO.getIsTop())
//                        .eqIfPresent(LeaveInfoDO::getSort, reqVO.getSort())
//                        .eqIfPresent(LeaveInfoDO::getAudit, LeaveInfoAuditEnum.PASS_THE_AUDIT.getCode())
//                        .in(!CollectionUtil.isEmpty(areaList),LeaveInfoDO::getAreaId, areaList)
//                        .or(wrapper -> {
//                            wrapper.likeIfExists(LeaveInfoDO::getRealName, s)
//                                    .eqIfExists(LeaveInfoDO::getUserId, reqVO.getUserId())
//                                    .eqIfExists(LeaveInfoDO::getBirthday, reqVO.getBirthday())
//                                    .eqIfExists(LeaveInfoDO::getIsTop, reqVO.getIsTop())
//                                    .eqIfExists(LeaveInfoDO::getSort, reqVO.getSort())
//                                    .eqIfExists(LeaveInfoDO::getAudit, LeaveInfoAuditEnum.PASS_THE_AUDIT.getCode())
//                                    .in(!CollectionUtil.isEmpty(areaList),LeaveInfoDO::getAreaId, areaList);
//                        })
//                        .or(wrapper -> {
//                            wrapper.likeIfExists(LeaveInfoDO::getSex, s)
//                                    .eqIfExists(LeaveInfoDO::getUserId, reqVO.getUserId())
//                                    .eqIfExists(LeaveInfoDO::getBirthday, reqVO.getBirthday())
//                                    .eqIfExists(LeaveInfoDO::getIsTop, reqVO.getIsTop())
//                                    .eqIfExists(LeaveInfoDO::getSort, reqVO.getSort())
//                                    .eqIfExists(LeaveInfoDO::getAudit, LeaveInfoAuditEnum.PASS_THE_AUDIT.getCode())
//                                    .in(!CollectionUtil.isEmpty(areaList),LeaveInfoDO::getAreaId, areaList);
//                        })
//                        .or(wrapper -> {
//                            wrapper.likeIfExists(LeaveInfoDO::getAge, s)
//                                    .eqIfExists(LeaveInfoDO::getUserId, reqVO.getUserId())
//                                    .eqIfExists(LeaveInfoDO::getBirthday, reqVO.getBirthday())
//                                    .eqIfExists(LeaveInfoDO::getIsTop, reqVO.getIsTop())
//                                    .eqIfExists(LeaveInfoDO::getSort, reqVO.getSort())
//                                    .eqIfExists(LeaveInfoDO::getAudit, LeaveInfoAuditEnum.PASS_THE_AUDIT.getCode())
//                                    .in(!CollectionUtil.isEmpty(areaList),LeaveInfoDO::getAreaId, areaList);
//                        })
//                        .or(wrapper -> {
//                            wrapper.likeIfExists(LeaveInfoDO::getDescription, s)
//                                    .eqIfExists(LeaveInfoDO::getUserId, reqVO.getUserId())
//                                    .eqIfExists(LeaveInfoDO::getBirthday, reqVO.getBirthday())
//                                    .eqIfExists(LeaveInfoDO::getIsTop, reqVO.getIsTop())
//                                    .eqIfExists(LeaveInfoDO::getSort, reqVO.getSort())
//                                    .eqIfExists(LeaveInfoDO::getAudit, LeaveInfoAuditEnum.PASS_THE_AUDIT.getCode())
//                                    .in(!CollectionUtil.isEmpty(areaList),LeaveInfoDO::getAreaId, areaList);
//                        })
//                        .leftJoin(MemberUserDO.class, MemberUserDO::getId, LeaveInfoDO::getUserId)
//                        .leftJoin(BusinessUserDO.class, BusinessUserDO::getUserId, LeaveInfoDO::getUserId)
//                        .leftJoin(BusinessCreditDO.class, BusinessCreditDO::getId, BusinessUserDO::getCreditId)
//                        .leftJoin(MemberTypeDO.class, MemberTypeDO::getId, BusinessUserDO::getMemberTypeId)
//                        .selectAs(BusinessCreditDO::getLevel, AppLeaveInfoRespVO::getLevel)
//                        .selectAs(BusinessCreditDO::getIcon, AppLeaveInfoRespVO::getIcon)
//                        .selectAs(BusinessUserDO::getIsAuth, AppLeaveInfoRespVO::getIsAuth)
//                        .selectAs(BusinessUserDO::getAreaId, AppLeaveInfoRespVO::getUserAreaId)
//                        .selectAs(MemberTypeDO::getName, AppLeaveInfoRespVO::getMemberTypeName)
//                        .selectAs(MemberTypeDO::getIcon, AppLeaveInfoRespVO::getMemberTypeIcon)
//                        .selectAs(MemberUserDO::getNickname, AppLeaveInfoRespVO::getNickname)
//                        .selectAs(MemberUserDO::getAvatar, AppLeaveInfoRespVO::getAvatar)
//                        .selectAll(LeaveInfoDO.class)
//                        .orderByDesc(LeaveInfoDO::getIsTop)
//                        .orderByAsc(LeaveInfoDO::getSort));
//                list.addAll(data);
//            }
//            if (!CollectionUtil.isEmpty(list)) {
//                return list.stream().distinct().collect(Collectors.toList());
//            }
//            return list;
//        }
       return  null;
    }

    default List<AppLeaveInfoRespVO> getMyPublishLeaveInfoListBack(AppLeaveInfoPageReqVO reqVO) {
//        String keywords = reqVO.getKeywords();
//        if (!StringUtils.isEmpty(keywords)) {
//            String[] split = keywords.split(" ");
//            List<AppLeaveInfoRespVO> list = new ArrayList<>();
//            for (String s : split) {
//                List<AppLeaveInfoRespVO> data = selectJoinList(AppLeaveInfoRespVO.class, new MPJLambdaWrapperX<LeaveInfoDO>()
//                        .likeIfPresent(LeaveInfoDO::getInfoName, s)
//                        .eqIfPresent(LeaveInfoDO::getUserId, reqVO.getUserId())
//                        .eqIfPresent(LeaveInfoDO::getBirthday, reqVO.getBirthday())
//                        .eqIfPresent(LeaveInfoDO::getIsTop, reqVO.getIsTop())
//                        .eqIfPresent(LeaveInfoDO::getSort, reqVO.getSort())
//                        .eqIfPresent(LeaveInfoDO::getAudit, LeaveInfoAuditEnum.PASS_THE_AUDIT.getCode())
//                        .or(wrapper -> {
//                            wrapper.likeIfExists(LeaveInfoDO::getRealName, s)
//                                    .eqIfExists(LeaveInfoDO::getUserId, reqVO.getUserId())
//                                    .eqIfExists(LeaveInfoDO::getBirthday, reqVO.getBirthday())
//                                    .eqIfExists(LeaveInfoDO::getIsTop, reqVO.getIsTop())
//                                    .eqIfExists(LeaveInfoDO::getSort, reqVO.getSort())
//                                    .eqIfExists(LeaveInfoDO::getAudit, LeaveInfoAuditEnum.PASS_THE_AUDIT.getCode());
//                        })
//                        .or(wrapper -> {
//                            wrapper.likeIfExists(LeaveInfoDO::getSex, s)
//                                    .eqIfExists(LeaveInfoDO::getUserId, reqVO.getUserId())
//                                    .eqIfExists(LeaveInfoDO::getBirthday, reqVO.getBirthday())
//                                    .eqIfExists(LeaveInfoDO::getIsTop, reqVO.getIsTop())
//                                    .eqIfExists(LeaveInfoDO::getSort, reqVO.getSort())
//                                    .eqIfExists(LeaveInfoDO::getAudit, LeaveInfoAuditEnum.PASS_THE_AUDIT.getCode());
//                        })
//                        .or(wrapper -> {
//                            wrapper.likeIfExists(LeaveInfoDO::getAge, s)
//                                    .eqIfExists(LeaveInfoDO::getUserId, reqVO.getUserId())
//                                    .eqIfExists(LeaveInfoDO::getBirthday, reqVO.getBirthday())
//                                    .eqIfExists(LeaveInfoDO::getIsTop, reqVO.getIsTop())
//                                    .eqIfExists(LeaveInfoDO::getSort, reqVO.getSort())
//                                    .eqIfExists(LeaveInfoDO::getAudit, LeaveInfoAuditEnum.PASS_THE_AUDIT.getCode());
//                        })
//                        .or(wrapper -> {
//                            wrapper.likeIfExists(LeaveInfoDO::getDescription, s)
//                                    .eqIfExists(LeaveInfoDO::getUserId, reqVO.getUserId())
//                                    .eqIfExists(LeaveInfoDO::getBirthday, reqVO.getBirthday())
//                                    .eqIfExists(LeaveInfoDO::getIsTop, reqVO.getIsTop())
//                                    .eqIfExists(LeaveInfoDO::getSort, reqVO.getSort())
//                                    .eqIfExists(LeaveInfoDO::getAudit, LeaveInfoAuditEnum.PASS_THE_AUDIT.getCode());
//                        })
//                        .leftJoin(MemberUserDO.class, MemberUserDO::getId, LeaveInfoDO::getUserId)
//                        .leftJoin(BusinessUserDO.class, BusinessUserDO::getUserId, LeaveInfoDO::getUserId)
//                        .leftJoin(BusinessCreditDO.class, BusinessCreditDO::getId, BusinessUserDO::getCreditId)
//                        .leftJoin(MemberTypeDO.class, MemberTypeDO::getId, BusinessUserDO::getMemberTypeId)
//                        .selectAs(BusinessCreditDO::getLevel, AppLeaveInfoRespVO::getLevel)
//                        .selectAs(BusinessCreditDO::getIcon, AppLeaveInfoRespVO::getIcon)
//                        .selectAs(BusinessUserDO::getIsAuth, AppLeaveInfoRespVO::getIsAuth)
//                        .selectAs(BusinessUserDO::getAreaId, AppLeaveInfoRespVO::getUserAreaId)
//                        .selectAs(MemberTypeDO::getName, AppLeaveInfoRespVO::getMemberTypeName)
//                        .selectAs(MemberTypeDO::getIcon, AppLeaveInfoRespVO::getMemberTypeIcon)
//                        .selectAs(MemberUserDO::getNickname, AppLeaveInfoRespVO::getNickname)
//                        .selectAs(MemberUserDO::getAvatar, AppLeaveInfoRespVO::getAvatar)
//                        .selectAll(LeaveInfoDO.class)
//                        .orderByDesc(LeaveInfoDO::getIsTop)
//                        .orderByAsc(LeaveInfoDO::getSort));
//                list.addAll(data);
//            }
//            if (!CollectionUtil.isEmpty(list)) {
//                return list.stream().distinct().collect(Collectors.toList());
//            }
//            return list;
//        }
        return  null;
    }

}
